import javax.swing.*;

import java.awt.*;
import java.awt.event.*;

public class LiveVideoScreen {
	JFrame LVFrame = new JFrame("Coverage Corner - Live Video Screen");
	RecentScore[] recentScores;
	MatchUp[] matchUPS;
	League league;
	RecentScoresScreen rSS = new RecentScoresScreen();
	
	public LiveVideoScreen() {
		
	}
	
	public void runLiveVideoScreen(League L, MatchUp[] matchup, RecentScore[] recent) {
		Toolkit tk = Toolkit.getDefaultToolkit();
		int screenWidth = ((int) tk.getScreenSize().getWidth());
		int screenHeight = ((int) tk.getScreenSize().getHeight());
		
		this.league = L;
		this.matchUPS = matchup;
		this.recentScores = recent;
		
		// Set the window to full screen mode
		LVFrame.setExtendedState(Frame.MAXIMIZED_BOTH);

		// Set background color to black
		Container con = LVFrame.getContentPane();
		con.setBackground(Color.blue);
		// Make sure sizing is alright
		LVFrame.validate();
		
		MouseListener LVListener = new MouseAdapter() {
			  public void mouseClicked(MouseEvent event) {
			    LVFrame.setVisible(false); // figure out the source
			    MainScreen ms = new MainScreen();
			    ms.runMainScreen(league, matchUPS,recentScores); // display the text in the clicked label
			    // message is a JLabel
			  }
			};
		LVFrame.addMouseListener(LVListener);
		
		// Pack it all up
		LVFrame.pack();

		// Set the default close operation to eit when you click the X button
		LVFrame.setDefaultCloseOperation(LVFrame.EXIT_ON_CLOSE);
		// Center the JFrame
		LVFrame.setLocationRelativeTo(null);
		// Set the visibility
		LVFrame.setVisible(true);
	}
}
